{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Model: Naive Bayes"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Importing Libraries"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "import _pickle as pickle\n",
    "import numpy as np\n",
    "import pandas as pd\n",
    "from sklearn.model_selection import train_test_split\n",
    "from sklearn.metrics import precision_score, recall_score, accuracy_score, f1_score, confusion_matrix, classification_report\n",
    "import matplotlib.pyplot as plt"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Loading in Data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [],
   "source": [
    "df = pd.read_excel('../top10_features.xlsx')\n",
    "df = df.drop(df.columns[0], axis = 1)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Scaling the Data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [],
   "source": [
    "from sklearn.preprocessing import StandardScaler\n",
    "\n",
    "scaler = StandardScaler()\n",
    "\n",
    "features_df = df.drop([\"Decision\"], 1)\n",
    "\n",
    "scaled_df = pd.DataFrame(scaler.fit_transform(features_df), \n",
    "                               index=features_df.index, \n",
    "                               columns=features_df.columns)\n",
    "\n",
    "df = scaled_df.join(df.Decision)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Splitting the Data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [],
   "source": [
    "X = df.drop([\"Decision\"], 1)\n",
    "y = df.Decision\n",
    "\n",
    "# Train, test, split\n",
    "X_train, X_test, y_train, y_test = train_test_split(X, y)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Helper Functions"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### Function for plotting confusion matrix"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [],
   "source": [
    "def plot_confusion_matrix(y_true, y_pred, labels=[\"Sell\", \"Buy\", \"Hold\"], \n",
    "                          normalize=False, title=None, cmap=plt.cm.coolwarm):\n",
    "\n",
    "    cm = confusion_matrix(y_true, y_pred)\n",
    "    fig, ax = plt.subplots(figsize=(12,6))\n",
    "    im = ax.imshow(cm, interpolation='nearest', cmap=cmap)\n",
    "    ax.figure.colorbar(im, ax=ax)\n",
    "    # We want to show all ticks...\n",
    "    ax.set(xticks=np.arange(cm.shape[1]),\n",
    "           yticks=np.arange(cm.shape[0]),\n",
    "           # ... and label them with the respective list entries\n",
    "           xticklabels=labels, yticklabels=labels,\n",
    "           title=title,\n",
    "           ylabel='ACTUAL',\n",
    "           xlabel='PREDICTED')\n",
    "    # Rotate the tick labels and set their alignment.\n",
    "    plt.setp(ax.get_xticklabels(), rotation=45, ha=\"right\",\n",
    "             rotation_mode=\"anchor\")\n",
    "    # Loop over data dimensions and create text annotations.\n",
    "    fmt = '.2f' if normalize else 'd'\n",
    "    thresh = cm.max() / 1.5\n",
    "    for i in range(cm.shape[0]):\n",
    "        for j in range(cm.shape[1]):\n",
    "            ax.text(j, i, format(cm[i, j], fmt),\n",
    "                    ha=\"center\", va=\"center\",\n",
    "                    color=\"snow\" if cm[i, j] > thresh else \"orange\",\n",
    "                    size=26)\n",
    "    ax.grid(False)\n",
    "    fig.tight_layout()\n",
    "    return ax"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Modeling\n",
    "The preferred evaluation metric used will be __Precision__ for each class.  They will be optimized using the __F1 Score-Macro-Average__ to balance the Precision and Recall.  This is done because we want to not only be correct when predicting but also make a decent amount of predictions for each class.  Classes such as 'Buy' and 'Sell' are more important than 'Hold'."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Fitting and Training"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {
    "scrolled": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "GaussianNB(priors=None, var_smoothing=1e-09)"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Importing the model\n",
    "from sklearn.naive_bayes import GaussianNB\n",
    "\n",
    "# Fitting and training\n",
    "clf = GaussianNB()\n",
    "clf.fit(X_train, y_train)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Printing out Evaluation Metrics"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "              precision    recall  f1-score   support\n",
      "\n",
      "        Sell       0.25      0.40      0.31         5\n",
      "         Buy       0.75      0.27      0.40        11\n",
      "        Hold       0.00      0.00      0.00         1\n",
      "\n",
      "    accuracy                           0.29        17\n",
      "   macro avg       0.33      0.22      0.24        17\n",
      "weighted avg       0.56      0.29      0.35        17\n",
      "\n"
     ]
    }
   ],
   "source": [
    "# Classifier predictions\n",
    "pred = clf.predict(X_test)\n",
    "\n",
    "#Printing out results\n",
    "report = classification_report(y_test, pred, target_names=['Sell', 'Buy', 'Hold'])\n",
    "print(report)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Confusion Matrix"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAeEAAAGoCAYAAABxHV2qAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjAsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+17YcXAAAgAElEQVR4nO3debxcdXn48c9ztyyEJJCELQGibJZNEETZREUEFJCfWkFlVYv+XNBqS23rD0WrttUidalt6g6oSBUVxQ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/qn5+1+o1eoGfA3cCn6GyU9N6bwFWVeO5E5hcvf6XMvOb4/ynkVQjjo6WhhARKzJzWvX5+cANmXn2gOPfBO7OzE8OTKYDzvUAsG9mLo2IacACoDszT+7/uYjYEvgdcHxmXlvdRu8NwJWZ+aeB56q+PqX6+r0DrvmceCLi+VSS/79n5tdr9M8kaRxsjpZG5kpgx0GOXwvMHc2JqvNM3wUcGxGbD3j7PcA3M/PaatnMzP9Zn4DHIzPvo7Jv9enjPZek2jAJSxsRER3AkQzY/Sgi2oFDgR/3O7xDRNzU73HwYOfMzGeoNGXvNOCt3YEbxhDmcQOuO2WIcr8HXjCG80uaAPYJS0ObEhE3VZ9fCXx1wPH5VBLmpf0+84fM3GuE54+aRFlxwSDN0RN9TUnjZE1YGtrqzNyr+nhfZq7rfxzYHuii0oQ8KhGxKZUkfveAtxYB+4wj5o3Zm8pgLUklYBKWxqi6rd3pwN9EROdIP1cdmPUfwA8z88kBb38RODkiXtKv/AkRsdV4460O1PoslW35JJWAzdHSOGTmjRFxM3A8lSbrHfo1YQN8LTM/X33+6+po5zbgIuATg5zvTxFxPPDZiNgC6AOuoDKqeTjHRcRB/V6/G1hcjedG/jxF6QuOjJbKwylKkiQVxOZoSZIKYhKWJKkgJmFJkgpiEpYkqSAmYUmSCmISliSpICZhSZIK8v8BvKmQTGAecYEAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 864x432 with 2 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "plot_confusion_matrix(y_test, pred, title=\"Confusion Matrix\")\n",
    "np.set_printoptions(precision=1)\n",
    "# Plot non-normalized confusion matrix\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Tuning Model Parameters"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [],
   "source": [
    "from sklearn.model_selection import GridSearchCV"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Parameters"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Parameters to Tune\n",
    "params = {'var_smoothing': [1.5**-i for i in range(-20,20, 2)]}"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Fitting 3 folds for each of 20 candidates, totalling 60 fits\n",
      "[CV] var_smoothing=3325.256730079651 .................................\n",
      "[CV]  var_smoothing=3325.256730079651, score=(train=0.204, test=0.202), total=   0.0s\n",
      "[CV] var_smoothing=3325.256730079651 .................................\n",
      "[CV]  var_smoothing=3325.256730079651, score=(train=0.201, test=0.208), total=   0.0s\n",
      "[CV] var_smoothing=3325.256730079651 .................................\n",
      "[CV]  var_smoothing=3325.256730079651, score=(train=0.205, test=0.200), total=   0.0s\n",
      "[CV] var_smoothing=1477.8918800354004 ................................\n",
      "[CV]  var_smoothing=1477.8918800354004, score=(train=0.204, test=0.202), total=   0.0s\n",
      "[CV] var_smoothing=1477.8918800354004 ................................\n",
      "[CV]  var_smoothing=1477.8918800354004, score=(train=0.201, test=0.208), total=   0.0s\n",
      "[CV] var_smoothing=1477.8918800354004 ................................\n",
      "[CV]  var_smoothing=1477.8918800354004, score=(train=0.205, test=0.200), total=   0.0s\n",
      "[CV] var_smoothing=656.8408355712891 .................................\n",
      "[CV]  var_smoothing=656.8408355712891, score=(train=0.204, test=0.202), total=   0.0s\n",
      "[CV] var_smoothing=656.8408355712891 .................................\n",
      "[CV]  var_smoothing=656.8408355712891, score=(train=0.201, test=0.208), total=   0.0s\n",
      "[CV] var_smoothing=656.8408355712891 .................................\n",
      "[CV]  var_smoothing=656.8408355712891, score=(train=0.205, test=0.200), total=   0.0s\n",
      "[CV] var_smoothing=291.92926025390625 ................................\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "[Parallel(n_jobs=1)]: Using backend SequentialBackend with 1 concurrent workers.\n",
      "C:\\Users\\72445\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\sklearn\\metrics\\classification.py:1437: UndefinedMetricWarning: F-score is ill-defined and being set to 0.0 in labels with no predicted samples.\n",
      "  'precision', 'predicted', average, warn_for)\n",
      "C:\\Users\\72445\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\sklearn\\metrics\\classification.py:1437: UndefinedMetricWarning: F-score is ill-defined and being set to 0.0 in labels with no predicted samples.\n",
      "  'precision', 'predicted', average, warn_for)\n",
      "[Parallel(n_jobs=1)]: Done   1 out of   1 | elapsed:    0.0s remaining:    0.0s\n",
      "C:\\Users\\72445\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\sklearn\\metrics\\classification.py:1437: UndefinedMetricWarning: F-score is ill-defined and being set to 0.0 in labels with no predicted samples.\n",
      "  'precision', 'predicted', average, warn_for)\n",
      "C:\\Users\\72445\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\sklearn\\metrics\\classification.py:1437: UndefinedMetricWarning: F-score is ill-defined and being set to 0.0 in labels with no predicted samples.\n",
      "  'precision', 'predicted', average, warn_for)\n",
      "[Parallel(n_jobs=1)]: Done   2 out of   2 | elapsed:    0.0s remaining:    0.0s\n",
      "C:\\Users\\72445\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\sklearn\\metrics\\classification.py:1437: UndefinedMetricWarning: F-score is ill-defined and being set to 0.0 in labels with no predicted samples.\n",
      "  'precision', 'predicted', average, warn_for)\n",
      "C:\\Users\\72445\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\sklearn\\metrics\\classification.py:1437: UndefinedMetricWarning: F-score is ill-defined and being set to 0.0 in labels with no predicted samples.\n",
      "  'precision', 'predicted', average, warn_for)\n",
      "[Parallel(n_jobs=1)]: Done   3 out of   3 | elapsed:    0.0s remaining:    0.0s\n",
      "C:\\Users\\72445\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\sklearn\\metrics\\classification.py:1437: UndefinedMetricWarning: F-score is ill-defined and being set to 0.0 in labels with no predicted samples.\n",
      "  'precision', 'predicted', average, warn_for)\n",
      "C:\\Users\\72445\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\sklearn\\metrics\\classification.py:1437: UndefinedMetricWarning: F-score is ill-defined and being set to 0.0 in labels with no predicted samples.\n",
      "  'precision', 'predicted', average, warn_for)\n",
      "[Parallel(n_jobs=1)]: Done   4 out of   4 | elapsed:    0.0s remaining:    0.0s\n",
      "C:\\Users\\72445\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\sklearn\\metrics\\classification.py:1437: UndefinedMetricWarning: F-score is ill-defined and being set to 0.0 in labels with no predicted samples.\n",
      "  'precision', 'predicted', average, warn_for)\n",
      "C:\\Users\\72445\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\sklearn\\metrics\\classification.py:1437: UndefinedMetricWarning: F-score is ill-defined and being set to 0.0 in labels with no predicted samples.\n",
      "  'precision', 'predicted', average, warn_for)\n",
      "C:\\Users\\72445\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\sklearn\\metrics\\classification.py:1437: UndefinedMetricWarning: F-score is ill-defined and being set to 0.0 in labels with no predicted samples.\n",
      "  'precision', 'predicted', average, warn_for)\n",
      "C:\\Users\\72445\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\sklearn\\metrics\\classification.py:1437: UndefinedMetricWarning: F-score is ill-defined and being set to 0.0 in labels with no predicted samples.\n",
      "  'precision', 'predicted', average, warn_for)\n",
      "C:\\Users\\72445\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\sklearn\\metrics\\classification.py:1437: UndefinedMetricWarning: F-score is ill-defined and being set to 0.0 in labels with no predicted samples.\n",
      "  'precision', 'predicted', average, warn_for)\n",
      "C:\\Users\\72445\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\sklearn\\metrics\\classification.py:1437: UndefinedMetricWarning: F-score is ill-defined and being set to 0.0 in labels with no predicted samples.\n",
      "  'precision', 'predicted', average, warn_for)\n",
      "C:\\Users\\72445\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\sklearn\\metrics\\classification.py:1437: UndefinedMetricWarning: F-score is ill-defined and being set to 0.0 in labels with no predicted samples.\n",
      "  'precision', 'predicted', average, warn_for)\n",
      "C:\\Users\\72445\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\sklearn\\metrics\\classification.py:1437: UndefinedMetricWarning: F-score is ill-defined and being set to 0.0 in labels with no predicted samples.\n",
      "  'precision', 'predicted', average, warn_for)\n",
      "C:\\Users\\72445\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\sklearn\\metrics\\classification.py:1437: UndefinedMetricWarning: F-score is ill-defined and being set to 0.0 in labels with no predicted samples.\n",
      "  'precision', 'predicted', average, warn_for)\n",
      "C:\\Users\\72445\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\sklearn\\metrics\\classification.py:1437: UndefinedMetricWarning: F-score is ill-defined and being set to 0.0 in labels with no predicted samples.\n",
      "  'precision', 'predicted', average, warn_for)\n",
      "C:\\Users\\72445\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\sklearn\\metrics\\classification.py:1437: UndefinedMetricWarning: F-score is ill-defined and being set to 0.0 in labels with no predicted samples.\n",
      "  'precision', 'predicted', average, warn_for)\n",
      "C:\\Users\\72445\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\sklearn\\metrics\\classification.py:1437: UndefinedMetricWarning: F-score is ill-defined and being set to 0.0 in labels with no predicted samples.\n",
      "  'precision', 'predicted', average, warn_for)\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[CV]  var_smoothing=291.92926025390625, score=(train=0.204, test=0.202), total=   0.0s\n",
      "[CV] var_smoothing=291.92926025390625 ................................\n",
      "[CV]  var_smoothing=291.92926025390625, score=(train=0.201, test=0.208), total=   0.0s\n",
      "[CV] var_smoothing=291.92926025390625 ................................\n",
      "[CV]  var_smoothing=291.92926025390625, score=(train=0.205, test=0.200), total=   0.0s\n",
      "[CV] var_smoothing=129.746337890625 ..................................\n",
      "[CV]  var_smoothing=129.746337890625, score=(train=0.204, test=0.202), total=   0.0s\n",
      "[CV] var_smoothing=129.746337890625 ..................................\n",
      "[CV]  var_smoothing=129.746337890625, score=(train=0.201, test=0.208), total=   0.0s\n",
      "[CV] var_smoothing=129.746337890625 ..................................\n",
      "[CV]  var_smoothing=129.746337890625, score=(train=0.205, test=0.200), total=   0.0s\n",
      "[CV] var_smoothing=57.6650390625 .....................................\n",
      "[CV]  var_smoothing=57.6650390625, score=(train=0.204, test=0.202), total=   0.0s\n",
      "[CV] var_smoothing=57.6650390625 .....................................\n",
      "[CV]  var_smoothing=57.6650390625, score=(train=0.239, test=0.208), total=   0.0s\n",
      "[CV] var_smoothing=57.6650390625 .....................................\n",
      "[CV]  var_smoothing=57.6650390625, score=(train=0.205, test=0.200), total=   0.0s\n",
      "[CV] var_smoothing=25.62890625 .......................................\n",
      "[CV]  var_smoothing=25.62890625, score=(train=0.243, test=0.202), total=   0.0s\n",
      "[CV] var_smoothing=25.62890625 .......................................\n",
      "[CV]  var_smoothing=25.62890625, score=(train=0.294, test=0.208), total=   0.0s\n",
      "[CV] var_smoothing=25.62890625 .......................................\n",
      "[CV]  var_smoothing=25.62890625, score=(train=0.278, test=0.200), total=   0.0s\n",
      "[CV] var_smoothing=11.390625 .........................................\n",
      "[CV]  var_smoothing=11.390625, score=(train=0.243, test=0.202), total=   0.0s\n",
      "[CV] var_smoothing=11.390625 .........................................\n",
      "[CV]  var_smoothing=11.390625, score=(train=0.387, test=0.318), total=   0.0s\n",
      "[CV] var_smoothing=11.390625 .........................................\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\Users\\72445\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\sklearn\\metrics\\classification.py:1437: UndefinedMetricWarning: F-score is ill-defined and being set to 0.0 in labels with no predicted samples.\n",
      "  'precision', 'predicted', average, warn_for)\n",
      "C:\\Users\\72445\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\sklearn\\metrics\\classification.py:1437: UndefinedMetricWarning: F-score is ill-defined and being set to 0.0 in labels with no predicted samples.\n",
      "  'precision', 'predicted', average, warn_for)\n",
      "C:\\Users\\72445\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\sklearn\\metrics\\classification.py:1437: UndefinedMetricWarning: F-score is ill-defined and being set to 0.0 in labels with no predicted samples.\n",
      "  'precision', 'predicted', average, warn_for)\n",
      "C:\\Users\\72445\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\sklearn\\metrics\\classification.py:1437: UndefinedMetricWarning: F-score is ill-defined and being set to 0.0 in labels with no predicted samples.\n",
      "  'precision', 'predicted', average, warn_for)\n",
      "C:\\Users\\72445\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\sklearn\\metrics\\classification.py:1437: UndefinedMetricWarning: F-score is ill-defined and being set to 0.0 in labels with no predicted samples.\n",
      "  'precision', 'predicted', average, warn_for)\n",
      "C:\\Users\\72445\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\sklearn\\metrics\\classification.py:1437: UndefinedMetricWarning: F-score is ill-defined and being set to 0.0 in labels with no predicted samples.\n",
      "  'precision', 'predicted', average, warn_for)\n",
      "C:\\Users\\72445\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\sklearn\\metrics\\classification.py:1437: UndefinedMetricWarning: F-score is ill-defined and being set to 0.0 in labels with no predicted samples.\n",
      "  'precision', 'predicted', average, warn_for)\n",
      "C:\\Users\\72445\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\sklearn\\metrics\\classification.py:1437: UndefinedMetricWarning: F-score is ill-defined and being set to 0.0 in labels with no predicted samples.\n",
      "  'precision', 'predicted', average, warn_for)\n",
      "C:\\Users\\72445\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\sklearn\\metrics\\classification.py:1437: UndefinedMetricWarning: F-score is ill-defined and being set to 0.0 in labels with no predicted samples.\n",
      "  'precision', 'predicted', average, warn_for)\n",
      "C:\\Users\\72445\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\sklearn\\metrics\\classification.py:1437: UndefinedMetricWarning: F-score is ill-defined and being set to 0.0 in labels with no predicted samples.\n",
      "  'precision', 'predicted', average, warn_for)\n",
      "C:\\Users\\72445\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\sklearn\\metrics\\classification.py:1437: UndefinedMetricWarning: F-score is ill-defined and being set to 0.0 in labels with no predicted samples.\n",
      "  'precision', 'predicted', average, warn_for)\n",
      "C:\\Users\\72445\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\sklearn\\metrics\\classification.py:1437: UndefinedMetricWarning: F-score is ill-defined and being set to 0.0 in labels with no predicted samples.\n",
      "  'precision', 'predicted', average, warn_for)\n",
      "C:\\Users\\72445\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\sklearn\\metrics\\classification.py:1437: UndefinedMetricWarning: F-score is ill-defined and being set to 0.0 in labels with no predicted samples.\n",
      "  'precision', 'predicted', average, warn_for)\n",
      "C:\\Users\\72445\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\sklearn\\metrics\\classification.py:1437: UndefinedMetricWarning: F-score is ill-defined and being set to 0.0 in labels with no predicted samples.\n",
      "  'precision', 'predicted', average, warn_for)\n",
      "C:\\Users\\72445\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\sklearn\\metrics\\classification.py:1437: UndefinedMetricWarning: F-score is ill-defined and being set to 0.0 in labels with no predicted samples.\n",
      "  'precision', 'predicted', average, warn_for)\n",
      "C:\\Users\\72445\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\sklearn\\metrics\\classification.py:1437: UndefinedMetricWarning: F-score is ill-defined and being set to 0.0 in labels with no predicted samples.\n",
      "  'precision', 'predicted', average, warn_for)\n",
      "C:\\Users\\72445\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\sklearn\\metrics\\classification.py:1437: UndefinedMetricWarning: F-score is ill-defined and being set to 0.0 in labels with no predicted samples.\n",
      "  'precision', 'predicted', average, warn_for)\n",
      "C:\\Users\\72445\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\sklearn\\metrics\\classification.py:1437: UndefinedMetricWarning: F-score is ill-defined and being set to 0.0 in labels with no predicted samples.\n",
      "  'precision', 'predicted', average, warn_for)\n",
      "C:\\Users\\72445\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\sklearn\\metrics\\classification.py:1437: UndefinedMetricWarning: F-score is ill-defined and being set to 0.0 in labels with no predicted samples.\n",
      "  'precision', 'predicted', average, warn_for)\n",
      "C:\\Users\\72445\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\sklearn\\metrics\\classification.py:1437: UndefinedMetricWarning: F-score is ill-defined and being set to 0.0 in labels with no predicted samples.\n",
      "  'precision', 'predicted', average, warn_for)\n",
      "C:\\Users\\72445\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\sklearn\\metrics\\classification.py:1437: UndefinedMetricWarning: F-score is ill-defined and being set to 0.0 in labels with no predicted samples.\n",
      "  'precision', 'predicted', average, warn_for)\n",
      "C:\\Users\\72445\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\sklearn\\metrics\\classification.py:1437: UndefinedMetricWarning: F-score is ill-defined and being set to 0.0 in labels with no predicted samples.\n",
      "  'precision', 'predicted', average, warn_for)\n",
      "C:\\Users\\72445\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\sklearn\\metrics\\classification.py:1437: UndefinedMetricWarning: F-score is ill-defined and being set to 0.0 in labels with no predicted samples.\n",
      "  'precision', 'predicted', average, warn_for)\n",
      "C:\\Users\\72445\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\sklearn\\metrics\\classification.py:1437: UndefinedMetricWarning: F-score is ill-defined and being set to 0.0 in labels with no predicted samples.\n",
      "  'precision', 'predicted', average, warn_for)\n",
      "C:\\Users\\72445\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\sklearn\\metrics\\classification.py:1437: UndefinedMetricWarning: F-score is ill-defined and being set to 0.0 in labels with no predicted samples.\n",
      "  'precision', 'predicted', average, warn_for)\n",
      "C:\\Users\\72445\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\sklearn\\metrics\\classification.py:1437: UndefinedMetricWarning: F-score is ill-defined and being set to 0.0 in labels with no predicted samples.\n",
      "  'precision', 'predicted', average, warn_for)\n",
      "C:\\Users\\72445\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\sklearn\\metrics\\classification.py:1437: UndefinedMetricWarning: F-score is ill-defined and being set to 0.0 in labels with no predicted samples.\n",
      "  'precision', 'predicted', average, warn_for)\n",
      "C:\\Users\\72445\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\sklearn\\metrics\\classification.py:1437: UndefinedMetricWarning: F-score is ill-defined and being set to 0.0 in labels with no predicted samples.\n",
      "  'precision', 'predicted', average, warn_for)\n",
      "C:\\Users\\72445\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\sklearn\\metrics\\classification.py:1437: UndefinedMetricWarning: F-score is ill-defined and being set to 0.0 in labels with no predicted samples.\n",
      "  'precision', 'predicted', average, warn_for)\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[CV]  var_smoothing=11.390625, score=(train=0.310, test=0.200), total=   0.0s\n",
      "[CV] var_smoothing=5.0625 ............................................\n",
      "[CV]  var_smoothing=5.0625, score=(train=0.278, test=0.260), total=   0.0s\n",
      "[CV] var_smoothing=5.0625 ............................................\n",
      "[CV]  var_smoothing=5.0625, score=(train=0.297, test=0.322), total=   0.0s\n",
      "[CV] var_smoothing=5.0625 ............................................\n",
      "[CV]  var_smoothing=5.0625, score=(train=0.340, test=0.207), total=   0.0s\n",
      "[CV] var_smoothing=2.25 ..............................................\n",
      "[CV]  var_smoothing=2.25, score=(train=0.409, test=0.260), total=   0.0s\n",
      "[CV] var_smoothing=2.25 ..............................................\n",
      "[CV]  var_smoothing=2.25, score=(train=0.447, test=0.295), total=   0.0s\n",
      "[CV] var_smoothing=2.25 ..............................................\n",
      "[CV]  var_smoothing=2.25, score=(train=0.410, test=0.261), total=   0.0s\n",
      "[CV] var_smoothing=1.0 ...............................................\n",
      "[CV]  var_smoothing=1.0, score=(train=0.408, test=0.260), total=   0.0s\n",
      "[CV] var_smoothing=1.0 ...............................................\n",
      "[CV]  var_smoothing=1.0, score=(train=0.350, test=0.159), total=   0.0s\n",
      "[CV] var_smoothing=1.0 ...............................................\n",
      "[CV]  var_smoothing=1.0, score=(train=0.387, test=0.189), total=   0.0s\n",
      "[CV] var_smoothing=0.4444444444444444 ................................\n",
      "[CV]  var_smoothing=0.4444444444444444, score=(train=0.472, test=0.295), total=   0.0s\n",
      "[CV] var_smoothing=0.4444444444444444 ................................\n",
      "[CV]  var_smoothing=0.4444444444444444, score=(train=0.378, test=0.159), total=   0.0s\n",
      "[CV] var_smoothing=0.4444444444444444 ................................\n",
      "[CV]  var_smoothing=0.4444444444444444, score=(train=0.363, test=0.189), total=   0.0s\n",
      "[CV] var_smoothing=0.19753086419753085 ...............................\n",
      "[CV]  var_smoothing=0.19753086419753085, score=(train=0.501, test=0.238), total=   0.0s\n",
      "[CV] var_smoothing=0.19753086419753085 ...............................\n",
      "[CV]  var_smoothing=0.19753086419753085, score=(train=0.376, test=0.159), total=   0.0s\n",
      "[CV] var_smoothing=0.19753086419753085 ...............................\n",
      "[CV]  var_smoothing=0.19753086419753085, score=(train=0.359, test=0.189), total=   0.0s\n",
      "[CV] var_smoothing=0.0877914951989026 ................................\n",
      "[CV]  var_smoothing=0.0877914951989026, score=(train=0.501, test=0.227), total=   0.0s\n",
      "[CV] var_smoothing=0.0877914951989026 ................................\n",
      "[CV]  var_smoothing=0.0877914951989026, score=(train=0.464, test=0.159), total=   0.0s\n",
      "[CV] var_smoothing=0.0877914951989026 ................................\n",
      "[CV]  var_smoothing=0.0877914951989026, score=(train=0.384, test=0.237), total=   0.0s\n",
      "[CV] var_smoothing=0.03901844231062338 ...............................\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\Users\\72445\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\sklearn\\metrics\\classification.py:1437: UndefinedMetricWarning: F-score is ill-defined and being set to 0.0 in labels with no predicted samples.\n",
      "  'precision', 'predicted', average, warn_for)\n",
      "C:\\Users\\72445\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\sklearn\\metrics\\classification.py:1437: UndefinedMetricWarning: F-score is ill-defined and being set to 0.0 in labels with no predicted samples.\n",
      "  'precision', 'predicted', average, warn_for)\n",
      "C:\\Users\\72445\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\sklearn\\metrics\\classification.py:1437: UndefinedMetricWarning: F-score is ill-defined and being set to 0.0 in labels with no predicted samples.\n",
      "  'precision', 'predicted', average, warn_for)\n",
      "C:\\Users\\72445\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\sklearn\\metrics\\classification.py:1437: UndefinedMetricWarning: F-score is ill-defined and being set to 0.0 in labels with no predicted samples.\n",
      "  'precision', 'predicted', average, warn_for)\n",
      "C:\\Users\\72445\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\sklearn\\metrics\\classification.py:1437: UndefinedMetricWarning: F-score is ill-defined and being set to 0.0 in labels with no predicted samples.\n",
      "  'precision', 'predicted', average, warn_for)\n",
      "C:\\Users\\72445\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\sklearn\\metrics\\classification.py:1437: UndefinedMetricWarning: F-score is ill-defined and being set to 0.0 in labels with no predicted samples.\n",
      "  'precision', 'predicted', average, warn_for)\n",
      "C:\\Users\\72445\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\sklearn\\metrics\\classification.py:1437: UndefinedMetricWarning: F-score is ill-defined and being set to 0.0 in labels with no predicted samples.\n",
      "  'precision', 'predicted', average, warn_for)\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[CV]  var_smoothing=0.03901844231062338, score=(train=0.529, test=0.289), total=   0.0s\n",
      "[CV] var_smoothing=0.03901844231062338 ...............................\n",
      "[CV]  var_smoothing=0.03901844231062338, score=(train=0.464, test=0.159), total=   0.0s\n",
      "[CV] var_smoothing=0.03901844231062338 ...............................\n",
      "[CV]  var_smoothing=0.03901844231062338, score=(train=0.472, test=0.237), total=   0.0s\n",
      "[CV] var_smoothing=0.017341529915832612 ..............................\n",
      "[CV]  var_smoothing=0.017341529915832612, score=(train=0.523, test=0.288), total=   0.0s\n",
      "[CV] var_smoothing=0.017341529915832612 ..............................\n",
      "[CV]  var_smoothing=0.017341529915832612, score=(train=0.463, test=0.223), total=   0.0s\n",
      "[CV] var_smoothing=0.017341529915832612 ..............................\n",
      "[CV]  var_smoothing=0.017341529915832612, score=(train=0.535, test=0.280), total=   0.0s\n",
      "[CV] var_smoothing=0.0077073466292589396 .............................\n",
      "[CV]  var_smoothing=0.0077073466292589396, score=(train=0.523, test=0.288), total=   0.0s\n",
      "[CV] var_smoothing=0.0077073466292589396 .............................\n",
      "[CV]  var_smoothing=0.0077073466292589396, score=(train=0.490, test=0.275), total=   0.0s\n",
      "[CV] var_smoothing=0.0077073466292589396 .............................\n",
      "[CV]  var_smoothing=0.0077073466292589396, score=(train=0.596, test=0.313), total=   0.0s\n",
      "[CV] var_smoothing=0.0034254873907817508 .............................\n",
      "[CV]  var_smoothing=0.0034254873907817508, score=(train=0.523, test=0.288), total=   0.0s\n",
      "[CV] var_smoothing=0.0034254873907817508 .............................\n",
      "[CV]  var_smoothing=0.0034254873907817508, score=(train=0.536, test=0.275), total=   0.0s\n",
      "[CV] var_smoothing=0.0034254873907817508 .............................\n",
      "[CV]  var_smoothing=0.0034254873907817508, score=(train=0.595, test=0.262), total=   0.0s\n",
      "[CV] var_smoothing=0.0015224388403474447 .............................\n",
      "[CV]  var_smoothing=0.0015224388403474447, score=(train=0.484, test=0.288), total=   0.0s\n",
      "[CV] var_smoothing=0.0015224388403474447 .............................\n",
      "[CV]  var_smoothing=0.0015224388403474447, score=(train=0.586, test=0.274), total=   0.0s\n",
      "[CV] var_smoothing=0.0015224388403474447 .............................\n",
      "[CV]  var_smoothing=0.0015224388403474447, score=(train=0.616, test=0.262), total=   0.0s\n",
      "[CV] var_smoothing=0.0006766394845988643 .............................\n",
      "[CV]  var_smoothing=0.0006766394845988643, score=(train=0.484, test=0.288), total=   0.0s\n",
      "[CV] var_smoothing=0.0006766394845988643 .............................\n",
      "[CV]  var_smoothing=0.0006766394845988643, score=(train=0.586, test=0.274), total=   0.0s\n",
      "[CV] var_smoothing=0.0006766394845988643 .............................\n",
      "[CV]  var_smoothing=0.0006766394845988643, score=(train=0.616, test=0.262), total=   0.0s\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "[Parallel(n_jobs=1)]: Done  60 out of  60 | elapsed:    0.7s finished\n",
      "C:\\Users\\72445\\AppData\\Local\\Continuum\\anaconda3\\lib\\site-packages\\sklearn\\model_selection\\_search.py:813: DeprecationWarning: The default of the `iid` parameter will change from True to False in version 0.22 and will be removed in 0.24. This will change numeric results when test-set sizes are unequal.\n",
      "  DeprecationWarning)\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "GridSearchCV(cv=3, error_score='raise-deprecating',\n",
       "             estimator=GaussianNB(priors=None, var_smoothing=1e-09), iid='warn',\n",
       "             n_jobs=None,\n",
       "             param_grid={'var_smoothing': [3325.256730079651,\n",
       "                                           1477.8918800354004,\n",
       "                                           656.8408355712891,\n",
       "                                           291.92926025390625, 129.746337890625,\n",
       "                                           57.6650390625, 25.62890625,\n",
       "                                           11.390625, 5.0625, 2.25, 1.0,\n",
       "                                           0.4444444444444444,\n",
       "                                           0.19753086419753085,\n",
       "                                           0.0877914951989026,\n",
       "                                           0.03901844231062338,\n",
       "                                           0.017341529915832612,\n",
       "                                           0.0077073466292589396,\n",
       "                                           0.0034254873907817508,\n",
       "                                           0.0015224388403474447,\n",
       "                                           0.0006766394845988643]},\n",
       "             pre_dispatch='2*n_jobs', refit=True, return_train_score=True,\n",
       "             scoring='f1_macro', verbose=5)"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "search = GridSearchCV(clf, params, cv=3, return_train_score=True, verbose=5, scoring='f1_macro')\n",
    "\n",
    "search.fit(X,y)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Tuned Results"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Mean Training Score: 0.3699906581916056\n",
      "Mean Testing Score: 0.43990290501918405\n",
      "\n",
      "Best Parameter Found:\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "{'var_smoothing': 0.0077073466292589396}"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "print(\"Mean Training Score:\", np.mean(search.cv_results_['mean_train_score']))\n",
    "print(\"Mean Testing Score:\", search.score(X, y))\n",
    "print(\"\\nBest Parameter Found:\")\n",
    "search.best_params_"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Model with the Best Parameters"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "GaussianNB(priors=None, var_smoothing=0.0077073466292589396)"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "search_clf = search.best_estimator_\n",
    "\n",
    "search_clf.fit(X_train, y_train)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### Results from Optimum Parameters"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "              precision    recall  f1-score   support\n",
      "\n",
      "        Sell       0.29      0.40      0.33         5\n",
      "         Buy       0.80      0.36      0.50        11\n",
      "        Hold       0.00      0.00      0.00         1\n",
      "\n",
      "    accuracy                           0.35        17\n",
      "   macro avg       0.36      0.25      0.28        17\n",
      "weighted avg       0.60      0.35      0.42        17\n",
      "\n"
     ]
    }
   ],
   "source": [
    "# Classifier predictions\n",
    "s_pred = search_clf.predict(X_test)\n",
    "\n",
    "#Printing out results\n",
    "report = classification_report(y_test, s_pred, target_names=['Sell', 'Buy', 'Hold'])\n",
    "print(report)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Confusion Matrix for Optimum Parameters"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAesAAAGoCAYAAABmP81jAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjAsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+17YcXAAAgAElEQVR4nO3deZhcZZn+8e/d3Vk6hCSEAAkhJIosIigMDDsjijqACDigIIIEcTKO4jIyw+DoDwQHFVeGZVQQlE3EDQSEwQWRVSDsBDCENSGBkIQkZE93Pb8/zglWKt3VW3Wdc6ruz3XVRdU5b516kkPlqXdXRGBmZmb51ZJ1AGZmZladk7WZmVnOOVmbmZnlnJO1mZlZzjlZm5mZ5ZyTtZmZWc45WZt1Q1K7pBskLZH0iwFc56OSflfL2LIg6WZJJ2Qdh1kzcrK2wpN0rKTpkpZJmpcmlf1qcOmjgC2ATSPiQ/29SERcFRHvq0E865F0gKSQ9OuK4+9Ij9/Wy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WuBR4H/iogL01N3AMOA/dP/mg06N4Ob1UHaJD4qIq7NOhbrG0nvBc4H9oyIJWXH31ht0GywOVmb1ZE35yimdOrkucDeEbEo63is+bgZ3KyOnKiLKR0NPhT4g6Tdk0O+l1Y/rlmbmfWSpJERsSzrOKz5OFmbmZnlnKdumZmZ5ZyTtZmZWc45WZuZmeWck7WZmVnOeeqWWTckdZIsDdoGPEmy9OuKiuPPAcdHxGJJU9Jyfy27zHcj4nJJz5NseQrJBhG/Br4aEavT990YETuln7sH8G1gCyBIdmB7CPjn9P07pp/RCfwf8BTwLZKdvdY5FliRxvMUMDz9/Asj4rIB/tWYWZ15NLhZNyQti4iR6fOrgAci4rsVxy8DZkbE2ZVJt+JazwO7R8QCSSOBi4C1EXFC+fskbQHcBxwTEfek2zMeCdwREa9UXit9PTV9fXLFZ64Xj6Q3k/xI+J+I+HGN/prMrA7cDG7WO3cAb+ni+D3AxL5cKJ2n+0ngCEljK05/GrgsIu5Jy0ZE/HJdoh6IiHiWZN/0zw70WmZWX07WZj2Q1AYcTMVuWZJagQOB68sObyPp4bLH/l1dMyKWkjShb1txaifggX6EeXTF57Z3U+5BYId+XN/MMuQ+a7PutUt6OH1+B3BJxfEpJIn192XveSYidunl9VWTKBPXdNEMPtifaWZ14pq1WfdWRsQu6eMzEbGm/DgwGRhK0nTdJ5I2Jkn2MytOzQB2G0DMPdmVZNCZmRWIk7VZP6XbJX4W+HdJQ3r7vnSA2f8C10XEaxWnLwBOkLRnWfnjJI0faLzpgLNvk2z3aGYF4mZwswGIiIckPQIcQ9JUvk1Z0znApRFxXvr8T+no7hbgWuCrXVzvFUnHAN+WtDlQAm4nGcVdzdGS9it7/SlgbhrPQ/xt6tb5HgluVjyeumVmZpZzbgY3MzPLOSdrMzOznHOyNjMzyzknazMzs5xzsjYzM8s5J2szM7Occ7I2MzPLuf8PTgrgUW21LnIAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 864x432 with 2 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "plot_confusion_matrix(y_test, s_pred, title=\"Confusion Matrix\")\n",
    "np.set_printoptions(precision=1)\n",
    "# Plot non-normalized confusion matrix\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
